﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _02.HumanClasses
{
    public abstract class Human
    {
        protected readonly string firstName;
        protected readonly string lastName;

        public Human(string firstName, string lastName)
        {
            if (firstName != string.Empty && firstName.Length >= 2)
            {
                this.firstName = firstName;
            }
            else
            {
                throw new ArgumentException("The name can't be empty!");
            }

            if (lastName != string.Empty && lastName.Length >= 2)
            {
                this.lastName = lastName;
            }
            else
            {
                throw new ArgumentException("The name can't be empty!");
            }
        }

        public string FirstName
        {
            get { return this.firstName; }
        }

        public string LastName
        {
            get { return this.lastName; }
        }


        public override string ToString()
        {
            return string.Format("{0} {1}", firstName, lastName);
        }

    }
}
